package com.yy.ant.chat.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 聊天记录表
 * </p>
 *
 * @author liyingying
 * @since 2020-01-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("chat_chatmessage")
public class Chatmessage implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户名
     */
    private String username;

    /**
     * 头像
     */
    private String avatar;

    /**
     * 时间戳,用此时间获取标准时间
     */
    private Long timestamp;

    /**
     * 消息内容
     */
    private String content;

    /**
     * 是否未读,用于离线消息,0已读,1未读
     */
    private Integer unreadpoint;

    /**
     * 消息类型,1.用户消息  2.群组消息
     */
    private Integer type;

    /**
     * 对方/接受消息的id
     */
    private Long toid;

    /**
     * 我的id
     */
    private Long froms;
    
    @TableField(exist=false)
    private Long from=froms;
    
    
    /**
     * 针对群组,此消息的未读人员
     */
    private String unreadnumbers;


}
